package com.zcy.gift.controller;

import com.zcy.gift.util.AjaxResult;
import com.zcy.gift.service.IAlibabaOSSService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * <p>
 *
 * </p>
 *
 * @author lucker
 * @date 2024/1/27 15:28
 */
@RequestMapping("/alioss")
@RestController
public class AlibabaOSSController {

    @Autowired
    private IAlibabaOSSService alibabaOSSService;

    @GetMapping("/sign")
    public AjaxResult ossSign(){
        return AjaxResult.me().setResultObj(alibabaOSSService.sign());
    }

    @DeleteMapping()
    public AjaxResult delete(@RequestParam(name = "filePath") String key) {
        alibabaOSSService.delete(key);
        return AjaxResult.me();
    }
}
